﻿using System;
using System.IO;


namespace SystemOfLog
{
    //============================
    interface BaseWriteMsg
    {
        void WriteMsg(string Msg);
    }
    //============================
    public class WriteMsgFile : BaseWriteMsg
    {
        private StreamWriter LogStream;
        //============================
        public void AddStream( StreamWriter stream )
        {
            LogStream = stream;           
        }
        //============================
        public void WriteMsg( string Msg )
        {
            using ( LogStream )
            {
                LogStream.WriteLine( DateTime.Now.ToString("HH:mm:ss") + " " + Msg );
            }
        }
        //============================     
    }
}
